package org.mozhu.mboot.core.web.sitemesh.tag;

import org.sitemesh.SiteMeshContext;
import org.sitemesh.content.ContentProperty;
import org.sitemesh.content.tagrules.TagRuleBundle;
import org.sitemesh.content.tagrules.html.ExportTagToContentRule;
import org.sitemesh.tagprocessor.State;

public class SiteMeshTagRuleBundle implements TagRuleBundle {
	
	@Override
	public void install(State defaultState, ContentProperty contentProperty, SiteMeshContext siteMeshContext) {
		defaultState.addRule("page-plugin-style", new ExportTagToContentRule(siteMeshContext, contentProperty.getChild("page-plugin-style"), false));
		defaultState.addRule("page-plugin-script", new ExportTagToContentRule(siteMeshContext, contentProperty.getChild("page-plugin-script"), false));
		defaultState.addRule("page-style", new ExportTagToContentRule(siteMeshContext, contentProperty.getChild("page-style"), false));
		defaultState.addRule("page-script", new ExportTagToContentRule(siteMeshContext, contentProperty.getChild("page-script"), false));
	}

	@Override
	public void cleanUp(State defaultState, ContentProperty contentProperty, SiteMeshContext siteMeshContext) {
	}
}